/**
 * 认证相关API
 */
import request from './request'

/**
 * 登录
 */
export function login(data) {
  return request({
    url: '/admin/auth/login',
    method: 'post',
    data
  })
}

/**
 * 获取当前用户信息
 */
export function getUserInfo() {
  return request({
    url: '/admin/auth/userinfo',
    method: 'get'
  })
}

/**
 * 登出
 */
export function logout() {
  return request({
    url: '/admin/auth/logout',
    method: 'post'
  })
}

/**
 * 刷新Token
 */
export function refreshToken(refreshToken) {
  return request({
    url: '/admin/auth/refresh',
    method: 'post',
    data: { refresh_token: refreshToken }
  })
}

